home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
awe2-0_1.lha
/
awe2-0.1
/
Src
/
RCS
/
HardwareContext-sun3.s,v
< prev
next >
Wrap
Text File
|
1989-06-21
|
4KB
|
234 lines
head 3.3;
branch ;
access ;
symbols ;
locks grunwald:3.3; strict;
comment @# @;
3.3
date 89.06.21.10.14.25; author grunwald; state Exp;
branches ;
next 3.2;
3.2
date 89.02.20.15.34.52; author grunwald; state Exp;
branches ;
next 3.1;
3.1
date 88.12.20.13.50.31; author grunwald; state Exp;
branches ;
next 1.2;
1.2
date 88.10.30.13.03.41; author grunwald; state Exp;
branches ;
next 1.1;
1.1
date 88.09.18.16.42.32; author grunwald; state Exp;
branches ;
next ;
desc
@@
3.3
log
@*** empty log message ***
@
text
@ .text
REGMASK = 0x3ffe | save d1-d7, a0-a5
REGSAVE = 56 | # bytes needed to save registers
REGOFFSET=56
|REGPUSHMASK = 0x7ffc | save d1-d7, a0-a5
|REGPULLMASK = 0x3ffe | save d1-d7, a0-a5
|REGSAVE = 56 | # bytes needed to save registers
|REGOFFSET=56
FLOATMASK=0xff
FLOATSAVE=96
FLOATOFFSET= (REGOFFSET + FLOATSAVE)
TOTALSAVE=REGSAVE + FLOATSAVE
|
| Data offsets into HardwareContext
|
THREAD_FP = 0
THREAD_SP = 4 + THREAD_FP
THREAD_BASE = 4 + THREAD_SP
THREAD_END = 4 + THREAD_BASE
THREAD_MAX = 4 + THREAD_END
|
| Stack offsets for arguments. The link is in 0, the return address
| is in 4.
|
CONTEXT_FROM = 8
CONTEXT_TO = 12
| CPU::switchTo(Thread*,Thread*)
|
| Transfer control from the active process to a new process.
|
.text
#ifdef __Cplusplus__
.globl __HardwareContext_magicSwitchTo
__HardwareContext_magicSwitchTo:
#endif
#ifdef c_plusplus
.globl _magicSwitchTo__15HardwareContextFP15HardwareContext
_magicSwitchTo__15HardwareContextFP15HardwareContext:
#endif
#ifdef __GNUG__
.globl _magicSwitchTo_PSHardwareContext_PSHardwareContext
_magicSwitchTo_PSHardwareContext_PSHardwareContext:
#endif
link a6,#-TOTALSAVE | reserve space on stack for saving reg
moveml #REGMASK,a6@@(-REGOFFSET) | save registers
fmovem #FLOATMASK,a6@@(-FLOATOFFSET)| and floating point registers
movl a6@@(CONTEXT_FROM),a0 | a4 = address of current Thread object
movl a6,a0@@(THREAD_FP) | TheCpu.thisProcess -> savedFP
movl a7,a0@@(THREAD_SP)
movl a6@@(CONTEXT_TO),a0 | a0 = address of dst Thread object
movl a0@@(THREAD_FP),a6 | load FP of destination Thread Object
movl a0@@(THREAD_SP),a7 | load SP of destination Thread
fmovem a6@@(-FLOATOFFSET),#FLOATMASK
moveml a6@@(-REGOFFSET),#REGMASK | restore registers
unlk a6 | restore FP
rts
#ifdef __Cplusplus__
.globl __HardwareContext_getSp
__HardwareContext_getSp:
#endif
#ifdef c_plusplus
.globl _getSp__15HardwareContextFv
_getSp__15HardwareContextFv:
#endif
#ifdef __GNUG__
.globl _getSp_PSHardwareContext
_getSp_PSHardwareContext:
#endif
movl a7,d0
rts
@
3.2
log
@Start using Gnu library heaps for schedulers
@
text
@d3 2
a4 2
REGSAVE = 58 | # bytes needed to save registers
REGOFFSET=58
d6 5
d12 1
a12 1
FLOATSAVE=64
d53 1
a53 2
link a6,#-TOTALSAVE | reserve space on stack for saving reg
@
3.1
log
@Steay version
@
text
@d44 2
a45 2
.globl _switchTo_PSCpu_PSThread_PSThread
_switchTo_PSCpu_PSThread_PSThread:
d77 2
a78 2
.globl _getSp_PSCpu
_getSp_PSCpu:
@
1.2
log
@*** empty log message ***
@
text
@d7 1
a7 1
FLOATSAVE=128
d37 4
a40 3
#ifdef __Cplusplus2__
.globl _switchTo__3CpuFP6ThreadT1
_switchTo__3CpuFP6ThreadT1:
d42 1
d47 1
d70 4
a73 3
#ifdef __Cplusplus2__
.globl _getSp__3CpuFv
_getSp__3CpuFv:
d75 1
@
1.1
log
@Initial revision
@
text
@d2 1
a2 2
|REGMASK = 0x3ffe | save d1-d7, a0-a5
REGMASK = 0x3fff
d12 4
a15 3
THREAD_VTBL = 0
THREAD_DEBUG = 4 + THREAD_VTBL
THREAD_FP = 4 + THREAD_DEBUG
d21 6
a26 3
ARG_OBJ = 8 | pointer to object instance
ARG1 = 12 | first arg
ARG2 = 16 | second arg
d33 3
a35 3
#ifdef __GCC__
.globl __Cpu_switchToFPCThread__PCThread___
__Cpu_switchToFPCThread__PCThread___:
d37 1
a37 1
#ifdef __NCC__
d50 1
a50 1
movl a6@@(ARG2),a0 | a4 = address of current Thread object
d54 1
a54 1
movl a6@@(ARG1),a0 | a0 = address of dst Thread object
d63 3
a65 3
#ifdef __GCC__
.globl __Cpu_getSp
__Cpu_getSp:
d67 1
a67 1
#ifdef __NCC__
@